﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

using DeepForest.Phone.Assets.Tools;

namespace Tester
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }        

        private void buttonWP7MessageBox_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                MessageBox.Show("WP7 Message Box", "WP7", MessageBoxButton.OK);
            }
            catch (Exception)
            {
                
            }
        }

        private void buttonYesNo_Click(object sender, RoutedEventArgs e)
        {
            NotificationTool.Show(
                "Exit",
                "Are you sure?",
                new NotificationAction("Yes", () => { }),
                new NotificationAction("No", () => { }));
        }

        private void buttonOkCancel_Click(object sender, RoutedEventArgs e)
        {
            NotificationTool.Show(
                "Erase",
                "You are about to loose your data!",
                new NotificationAction("OK", "OKActionTemplateKey", () => { }),
                new NotificationAction("Cancel", "CancelActionTemplateKey", () => { }));
        }

        private void buttonSaveLoad_Click(object sender, RoutedEventArgs e)
        {
            NotificationTool.Show(
                "Choose",
                "Choose an option.",
                new NotificationAction("Save", () => { }),
                new NotificationAction("Load", () => { }));
        }

        private void buttonAny_Click(object sender, RoutedEventArgs e)
        {
            NotificationTool.Show(
                "Custom",
                "Click on any of the buttons below.",
                new NotificationAction("Xxx", () => { }),
                new NotificationAction("Xxx", () => { }),
                new NotificationAction("Zzz", () => { }));
        }

        private void buttonShowAgain_Click(object sender, RoutedEventArgs e)
        {
            NotificationTool.ShowAgain(
                "Show Again",
                "Uncheck the show again message and this message won't appear again.",
                "Show this message again",
                false,
                suppressed => { },
                GetType().ToString(),
                new NotificationAction("Xxx", () => { }),
                new NotificationAction("Xxx", () => { }),
                new NotificationAction("Zzz", () => { }));
        }

        private void buttonForceShowAgain_Click(object sender, RoutedEventArgs e)
        {
            NotificationTool.ShowAgain(
                "Show Again",
                "Check the show again message so this message will appear again.",
                "Show this message again",
                true,
                suppressed => { },
                GetType().ToString(),
                new NotificationAction("Xxx", () => { }),
                new NotificationAction("Xxx", () => { }),
                new NotificationAction("Zzz", () => { }));
        }
    }
}